#pragma once
#include <string>
#include <iostream>

extern "C" {
#include <libavformat/avformat.h>
}

class RTSPStream {
public:
    RTSPStream(const std::string& url);
    ~RTSPStream();

    bool open();
    void close();
    bool readFrame(AVPacket* packet);
    std::string mCodeType;
private:
    std::string rtspUrl;
    AVFormatContext* formatCtx;
    int videoStreamIndex;
};


